<template>
	<view>
		<view class="bg">
			<view class="box">
				<view class="user">
					<view class="avatur-container">
						<image :src="userinfo.avatur"></image>
					</view>
					<view class="nickname">{{userinfo.nickname}}</view>
				</view>
				<view @click="goEdit()" class="edit">
					编辑资料
				</view>
			</view>
		</view>
	</view>
</template>

<script lang="ts" setup>
	import {ref,reactive} from "vue"
	import {onShow} from "@dcloudio/uni-app"
	let userinfo=ref({})
	onShow(()=>{
		userinfo.value=uni.getStorageSync('userinfo')
	})
	function goEdit(){
		uni.navigateTo({
			url:"/pages/user/information/index"
		})
	}
</script>

<style lang="scss">
	.bg{
		width: 100%;
		height: 450rpx;
		position: relative;
		border-radius: 0 0 30rpx 30rpx;
		background: linear-gradient(80deg,#f8e177 49.5%,transparent 49.5%,#fae68d 49.5%);
		
		.box{
			width: 100%;
			display: flex;
			box-sizing: border-box;
			position: absolute;
			bottom:50rpx;
			padding: 0 20rpx;
			justify-content: space-between;
			align-items: center;
			
			.user{
				display: flex;
				align-items: center;
				
				.avatur-container{
					margin-right: 25rpx;
					image{
						border-radius: 50%;
						border: 4rpx solid white;
						width: 150rpx;
						height: 150rpx;
					}
				}
				
				.nickname{
					font-size: 32rpx;
					letter-spacing: 0.1em;
				}
			}
			
			.edit{
				display: flex;
				align-items: center;
				justify-content: center;
				border:1rpx solid #676558;
				font-size: 28rpx;
				border-radius: 40rpx;
				padding: 10rpx 25rpx;
				color:#6d674f;
				letter-spacing: 0.1em;
			}
		}
	}
</style>
